<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <link rel="shortcut icon" href="favicon.ico">
  <link rel="stylesheet" href="/css/iconfont.css">
  <link rel="stylesheet" href="/css/global.css">
  <link rel="stylesheet" href="/css/bootstrap.min.css">
  <link rel="stylesheet" href="/css/bootstrap-theme.min.css">
  <link rel="stylesheet" href="/css/swiper.min.css">
  <link rel="stylesheet" href="/css/styles.css">
  <script src="/js/jquery.1.12.4.min.js" charset="UTF-8"></script>
  <script src="/js/bootstrap.min.js" charset="UTF-8"></script>
  <script src="/js/swiper.min.js" charset="UTF-8"></script>
  <script src="/js/global.js" charset="UTF-8"></script>
  <script src="/js/jquery.DJMask.2.1.1.js" charset="UTF-8"></script>
    <title>Title</title>
  <script src="/js/vue.js"></script>
  <script src="/js/axios.min.js"></script>
  <script src="/js/layui/layui.js"></script>
  <script type="text/javascript">
    /* 注册layui */
    layui.use('layer', function () {
      var layer = layui.layer;
    });

    layui.use('laydate', function(){
      var laydate = layui.laydate;

      //执行一个laydate实例
      laydate.render({
        elem: '#test1' //指定元素
      });
    });

    $(function(){
      new Vue({
        el: "#app",
        data: {
          user:{

          },
          username:""
        },
        methods:{
          logout(){
            localStorage.removeItem('userz')
          }

        },
        mounted: function () {
          this.user = JSON.parse(localStorage.getItem("userz"));
          console.log(this.user)

          // axios.get("http://192.168.6.125:8080/user/getUser",this.user).then(response=> {
          //   if (response.data.code==200) {
          //     this.user = response.data.data;
          //     this.username = response.data.data.name;
          //   }else{
          //     this.user=null;
          //     console.log(this.user)
          //   }
          // })
        }
      });
    })
  </script>
</head>
<body>
<div class="tab-header" id="app">
  <div class="inner">
    <div class="pull-left">
      <div class="pull-left">嗨~ <span class="cr">{{user.name}}</span>，欢迎来到<a style="margin-left: 5px" href="/index.html"><span class="cr">汉服商城</span></a></div>
      <a href="agent_level.html">网店代销</a>
      <a href="temp_article/udai_article4.html">帮助中心</a>
    </div>
    <div class="pull-right">
      <a href="/user/login" v-if="user==null"><span class="cr">登录</span></a>
      <a href="/user/login" v-if="user==null">注册</a>
      <a href="/user/ucenter">个人中心</a>
      <a href="/user/ucenter?src=uorder">我的订单</a>
      <a href="/user/logout" @click="logout" v-if="user!=null">退出登录</a>
    </div>
  </div>
</div>
</body>
</html>